layui.define(['element', 'yaml'], function(exports) {
	"use strict";

	/**
	 * Button component
	 * */
	var MOD_NAME = 'fast_config',
		$ = layui.jquery,
        yaml = layui.yaml,
        config = readConfig()
    ;



	var fast_config = config

    /**
	 * Button start loading
	 * */
     function readConfig() {

        var configType = 'yml';
        var configPath = window.rootPath.replace('/js', '/config') + 'application.yml';

        if (configType === "yml") {
            return yaml.load(configPath);
        } else {
            var data;
            $.ajax({
                url: configPath,
                type: 'get',
                dataType: 'json',
                async: false,
                success: function(result) {
                    data = result;
                }
            })
            return data;
        }
	}


    exports(MOD_NAME, fast_config);
});
